package protoType;

public class protoType implements Cloneable{
    private protoTypeB typeB = new protoTypeB();

    public protoType(String name) {
        this.typeB.setName(name);
    }

    @Override
    protected protoType clone() throws CloneNotSupportedException {
        protoType type=null;
        type.typeB=new protoTypeB();
        type =(protoType)super.clone();
        return type;
    }

    public void print(){
        System.out.println("这是一个原型类"+typeB.getName());
    }

}
